export interface GetAttrListParams {
  category1Id: number;
  category2Id: number;
  category3Id: number;
}

/*
  [
    {
      "id": 37,
      "attrName": "分类",
      "categoryId": 1,
      "categoryLevel": 3,
      "attrValueList": [
        {
          "id": 33,
          "valueName": "C#",
          "attrId": 37
        },
        {
          "id": 32,
          "valueName": "Java",
          "attrId": 37
        },
        {
          "id": 34,
          "valueName": "JavaScript",
          "attrId": 37
        }
      ]
    },
  ]
*/
// export interface AttrValueItem {
//   id: number;
//   valueName: string;
//   attrId: number;
// }

// export type AttrValueList = AttrValueItem[];

// export interface AttrItem {
//   id: number;
//   attrName: string; // 属性名称
//   categoryId: number;
//   categoryLevel: number;
//   attrValueList: AttrValueList; // 属性值列表
// }

// export type AttrList = AttrItem[];

/*
  添加属性类型：
  {
     "attrName": "string",
      "attrValueList": [
        {
          "valueName": "string"
        }
      ],
      "categoryId": 0,
      "categoryLevel": 0,
  }
  修改属性类型：
  {
    "attrName": "string",
    "attrValueList": [
      {
        "id": 0,
        "valueName": "string"
      }
    ],
    "categoryId": 0,
    "categoryLevel": 0,
    "id": 0
  }
  组件使用数据的类型 -> AttrItem
  {
    attrName: string,
    attrValueList: [
      {
        valueName: string,
        isEdit: boolean
      }
    ]
  }
*/
export interface AttrValueItem {
  valueName: string;
  id?: number;
  isEdit?: boolean;
}

export type AttrValueList = AttrValueItem[];

export interface AttrItem {
  id?: number;
  attrName: string;
  attrValueList: AttrValueList;
}

export type AttrList = AttrItem[];
// 添加属性参数类型
export interface SaveOrUpdateAttrParams extends AttrItem {
  categoryId: number;
  categoryLevel: number;
}
// 获取属性列表返回值类型
export type GetAttrListResponse = SaveOrUpdateAttrParams[];
